package PTA_5;

import java.util.Scanner;

public class t2 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String s = scan.nextLine();
        char[] ch = s.toCharArray();
        for (int i = 0; i < ch.length; i++) {
            if(ch[i] >= 'a' && ch[i] <= 'z') {
                ch[i] -= 32;
            } else if (ch[i] >= 'A' && ch[i] <= 'Z') {
                ch[i] += 32;
            }
        }
        s = new String(ch);
        s = new StringBuffer(s).reverse().toString();
        System.out.println(s);
    }
}
